<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		*{
			margin: 0px;
			padding: 0px;
		}
		li{
			list-style: none;
		}
		.menu_out{
			width: 100%;
			height: 40px;
			background: #01204F url() 0 0 no-repeat;
			margin-top: 100px;
		}

		.menu_mid{
			width: 900px;
			height: 40px;
			margin: 0 auto;
			position: relative;
		}
		.menu_list{
			width: 100%;
			height: 40px;
			position: relative;
			top: 0px;
			z-index: 999;
		}
		.menu_mid li{
			color: #fff;
			float: left;
			line-height: 40px;
			padding: 0 10px;
			cursor: pointer;
		}
		.run{
			width: 10px;
			height: 40px;
			background: #CC0000 url() 0 0 no-repeat;
			position: absolute;
			top: 0px;
			left: 0px;
			z-index: 888;
		}

		
	</style>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script>
		$(function(){
			$('.menu_list li').hover(function() {
				w = $(this).width()+20;
				l = $(this).position().left;

				$('.run').stop().animate({width: w+"px", left: l+"px"}, 300);
				// console.log(w);
				// console.log(l);
			}, function() {
				$('.run').stop().animate({width: "10px", left: "0px"}, 300);
			});
		})
	</script>
</head>
<body>
	<div class="menu_out">
		<div class="menu_mid">
			<ul class="menu_list">
				<li style="background:#CC0000">首页</li>
				<li>国内</li>
				<li>国际</li>
				<li>军事</li>
				<li>财经</li>
				<li>娱乐</li>
				<li>体育</li>
				<li>互联网</li>
				<li>科技</li>
				<li>游戏</li>
				<li>女人</li>
				<li>汽车</li>
				<li>房产</li>
			</ul>
			<div class="run"></div>
		</div>
	</div>
</body>
</html>